<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script>
 	function textClear(){ 
		var inputName=document.getElementById("inputName");
		if(inputName.value=="请输入用户名")inputName.value="";
	}
	function passwordClear(){
		var inputPassword=document.getElementById("inputPassword");
		if(inputPassword.value=="请输入密码"){
			inputPassword.value="";
			inputPassword.type="password";
		}
	}
	function textReset() {
		var inputName=document.getElementById("inputName");
		var inputPassword=document.getElementById("inputPassword");
		if(inputName.value=="" || inputName.value==null || inputName.value==undefined)inputName.value="请输入用户名"; 
		if(inputPassword.value=="" || inputPassword.value==null || inputPassword.value==undefined){
			inputPassword.value="请输入密码";
			inputPassword.type="text";
			}
	}
</script>
</head>
<body>
	<form action="HelloWorldTest" method="post">
    	<input id="inputName" name="username" type="text" value="请输入用户名" onBlur="textReset()" onClick="textClear()"><br>
        <input id="inputPassword" name="password" type="text" value="请输入密码" onBlur="textReset()" onClick="passwordClear()">
        <input id="button" name="buttonSubmit" type="submit" value="提交">
	</form>
</body>
</html>